package com.coolingme.shop;

/**
 * 门面模式
 *
 * @author wangyue
 * @date 2020/9/15 12:41
 */
public class FacadeService {

    private QualifyService qualifyService = new QualifyService();

    private PaymentService paymentService = new PaymentService();

    private LogisticsService logisticsService = new LogisticsService();

    public void exChange(GoodsInfo goodsInfo) {
        if (qualifyService.isAvailable(goodsInfo)) {
            if (paymentService.pay(goodsInfo)) {
                logisticsService.delivery(goodsInfo);
            }
        }
    }

}
